import express from 'express';
import db from './../../lib/dbHelper';
let adminRouter = express.Router();

//index页面
adminRouter.get("/index", (request, response, next) => {

    let muenSQL = "SELECT*FROM `sys_menu` WHERE m_status=1 ORDER BY m_orderby ";

    let webSQL = "SELECT*FROM `websiteinfo` ";

    db.query(webSQL, [], function (err, res1) {
        console.log(res1);

        db.query(muenSQL, [], function (err, res2) {
            response.render("./admin/index.html", {
                muen: res2,
                webinfo: res1
            });
        })


    })




})








module.exports = adminRouter;